//引入VueRouter
import VueRouter from 'vue-router'
import Vue from 'vue'
import LoginView from '@/views/LoginView.vue'
import HomeView from '@/views/HomeView.vue'
import ProfileView from '@/views/ProfileView.vue'
import AIAssistantView from '@/views/AIAssistantView.vue'
import ProblemsView from '@/views/ProblemsView.vue'
import GroupsView from '@/views/GroupsView.vue'
import StatisticsView from '@/views/StatisticsView.vue'
import TestView from '@/views/TestView.vue'
import GroupDetailView from '@/views/GroupDetailView.vue'
import GroupManageView from '@/views/GroupManageView.vue'
import ProblemDetailView from '@/views/ProblemDetailView.vue'
import ProblemUploadView from '@/views/ProblemUploadView.vue'
import TaskDetailView from '@/views/TaskDetailView.vue'
Vue.use(VueRouter)
//创建router实例对象，去管理一组一组的路由规则
export default new VueRouter({
	routes:[
		{
			path:'/',
			component:LoginView
		},
		{
			path:'/home',
			component:HomeView
		},
		{
			path:'/profile',
			component:ProfileView
		},
		{
			path:'/ai-assistant',
			component:AIAssistantView
		},
		{
			path:'/problems',
			component:ProblemsView
		},
		{
			path:'/problem/upload',
			component:ProblemUploadView
		},
		{
			path:'/groups',
			component:GroupsView
		},
		{
			path:'/statistics',
			component:StatisticsView
		},
		{
			path: '/test',
			name: 'test',
			component: TestView
		},
		{
			path: '/group/:id',
			name: 'GroupDetail',
			component: () => import('../views/GroupDetailView.vue')
		},
		{
			path: '/group/:id/manage',
			name: 'GroupManage',
			component: () => import('../views/GroupManageView.vue')
		},
		{
			path: '/problem/:id',
			name: 'ProblemDetail',
			component: () => import('../views/ProblemDetailView.vue')
		},
		{
			path: '/task/:id',
			name: 'TaskDetail',
			component: TaskDetailView
		}
	]
})
